package com.py.credit.dao;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;

import com.py.credit.entity.DynamicSqlEntity;
import com.py.credit.entity.ErrorData;
import com.py.credit.entity.common.InspectRule;

public interface RuleCheckingDao {

	List<InspectRule> selectColumnRule(@Param(value = "metricCode") String metricCode,
			@Param(value = "editionId") Integer editionId, @Param(value = "tableId") Integer tableId);

	void addErrorData(@Param(value = "metricCode") String metricCode, @Param(value = "metricName") String metricName,
			@Param(value = "value") String value, @Param(value = "tableId") Integer tableId,
			@Param(value = "managerId") Integer managerId, @Param(value = "deptId") Integer deptId,
			@Param(value = "reason") String reason, @Param(value = "id") int id, @Param(value = "status") String status,
			@Param(value = "type") String type);

	List<InspectRule> selctTableRules(@Param(value = "id") Integer id, @Param(value = "editionId") Integer editionId);

	List<InspectRule> selctTableRules2(@Param(value = "id") Integer id, @Param(value = "editionId") Integer editionId);

	int repeatCheck(@Param(value = "md5") String md5, @Param(value = "resourceId") String resourceId);

	Integer addRepeatData(DynamicSqlEntity entity);

	Integer selectCode(@Param(value = "deptId") Integer deptId, @Param(value = "tableId") Integer tableId);

	List<String> selectTybmForEnterprise(@Param(value = "sql") String sql);

	List<String> selectTybmForPerson(@Param(value = "sql") String sql);

	String selectRelationRule(@Param(value = "rootId") Integer rootId);

	// 删除关联
	// void insertBasicForEnterprise(@Param(value = "tybm") String tybm,
	// @Param(value = "A000001") String A000001,
	// @Param(value = "A000002") String A000002, @Param(value = "A000003")
	// String
	// A000003,
	// @Param(value = "A000004") String A000004, @Param(value = "A000005")
	// String
	// A000005,
	// @Param(value = "A000006") String A000006);

	// 删除关联
	// void insertBasicForPerson(@Param(value = "tybm") String tybm,
	// @Param(value =
	// "B000001") String B000001,
	// @Param(value = "B000002") String B000002, @Param(value = "B000003")
	// String
	// B000003);

	InspectRule selectRuleForId(@Param(value = "id") int id);

	// 删除关联
	// void addTableAndTybm(@Param(value = "tybm") String tybm, @Param(value =
	// "resourceId") String resourceId);

	@Deprecated
	int selectLastId(@Param(value = "tableName") String tableName);

	// 删除关联
	// void insertFrWaitData(@Param(value = "A000001") String A000001,
	// @Param(value
	// = "A000002") String A000002,
	// @Param(value = "A000003") String A000003, @Param(value = "A000004")
	// String
	// A000004,
	// @Param(value = "A000005") String A000005, @Param(value = "A000006")
	// String
	// A000006,
	// @Param(value = "rootId") int rootId, @Param(value = "deptId") int deptId,
	// @Param(value = "tableId") int tableId, @Param(value = "dataId")int
	// dataId);

	// 删除关联
	// void insertZrrWaitData(@Param(value = "B000001") String B000001,
	// @Param(value
	// = "B000002") String B000002,
	// @Param(value = "B000003") String B000003, @Param(value = "rootId") int
	// rootId,
	// @Param(value = "deptId") int deptId, @Param(value = "tableId") int
	// tableId,
	// @Param(value = "dataId")int dataId);

	public void batchAddErrorData(@Param(value = "list") List<ErrorData> list);
	
	Map<String,String> CheckType(@Param(value = "tablename")String tablename,@Param(value = "type")String type,@Param(value = "condition")String condition);

	
	/**
	 * @Title: SgsCheckType
	 * @Description: TODO(这里用一句话描述这个方法的作用)
	 * @param @param tablename
	 * @param @param string
	 * @param @param valueOf
	 * @param @return    设定文件
	 * @return List<Map<String,String>>    返回类型
	 * @throws
	*/
	
	List<Map<String, String>> SgsCheckType(@Param(value = "tablename")String tablename,@Param(value = "type")String type,@Param(value = "condition")String condition,@Param(value = "record_id")String record_id);

	Map<String, Object> selectTableType(@Param(value = "tableId")Integer tableId);
}
